home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / filesy~1 / mfsdefrg.zoo / minix_fs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  1.8 KB  |  76 lines

  1. #ifndef _LINUX_MINIX_FS_H
  2. #define _LINUX_MINIX_FS_H
  3.  
  4. /*
  5.  * The minix filesystem constants/structures
  6.  */
  7.  
  8. /*
  9.  * Thanks to Kees J Bot for sending me the definitions of the new
  10.  * minix filesystem (aka V2) with bigger inodes and 32-bit block
  11.  * pointers. It's not actually implemented yet, but I'll look into
  12.  * it.
  13.  */
  14.  
  15. #ifndef BLOCK_SIZE
  16. #define BLOCK_SIZE    1024l
  17. #endif
  18.  
  19. #define MINIX_NAME_LEN 14
  20. #define MINIX_ROOT_INO 1
  21.  
  22. #define MINIX_I_MAP_SLOTS    8
  23. #define MINIX_Z_MAP_SLOTS    8
  24. #define MINIX_SUPER_MAGIC    0x137F
  25. #define NEW_MINIX_SUPER_MAGIC    0x2468
  26.  
  27. #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
  28. #define NEW_MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof(struct new_minix_inode)))
  29. #define MINIX_DIR_ENTRIES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_dir_entry)))
  30.  
  31. struct minix_inode {
  32.     unsigned short i_mode;
  33.     unsigned short i_uid;
  34.     unsigned long i_size;
  35.     unsigned long i_time;
  36.     unsigned char i_gid;
  37.     unsigned char i_nlinks;
  38.     unsigned short i_zone[9];
  39. };
  40.  
  41. /*
  42.  * The new minix inode has all the time entries, as well as
  43.  * long block numbers and a third indirect block (7+1+1+1
  44.  * instead of 7+1+1). Also, some previously 8-bit values are
  45.  * now 16-bit. The inode is now 64 bytes instead of 32.
  46.  */
  47. struct new_minix_inode {
  48.     unsigned short i_mode;
  49.     unsigned short i_nlinks;
  50.     unsigned short i_uid;
  51.     unsigned short i_gid;
  52.     unsigned long i_size;
  53.     unsigned long i_atime;
  54.     unsigned long i_mtime;
  55.     unsigned long i_ctime;
  56.     unsigned long i_zone[10];
  57. };
  58.  
  59. /*
  60.  * minix super-block data on disk
  61.  */
  62. struct minix_super_block {
  63.     unsigned short s_ninodes;
  64.     unsigned short s_nzones;
  65.     unsigned short s_imap_blocks;
  66.     unsigned short s_zmap_blocks;
  67.     unsigned short s_firstdatazone;
  68.     unsigned short s_log_zone_size;
  69.     unsigned long s_max_size;
  70.     unsigned short s_magic;
  71.     unsigned short s_pad;    /* Padding */
  72.     unsigned long s_zones;    /* Number of zones for V2 */
  73. };
  74.  
  75. #endif
  76.